package com.kaifamiao.json;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.kaifamiao.enums.Gender;

import java.io.IOException;

public class GenderSerializer extends JsonSerializer<Gender> {

    @Override
    public void serialize(Gender gender, JsonGenerator generator, SerializerProvider provider) throws IOException {
        generator.writeString( gender.getText() );
    }

}
